package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.member.DevicePropertyData;
import com.zzyl.nursing.domain.member.FamilyElderData;
import com.zzyl.nursing.domain.member.FamilyMemberElderMy;
import com.zzyl.nursing.dto.FamilyDto;
import com.zzyl.nursing.vo.DeviceDataByDay;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;
import com.zzyl.nursing.domain.FamilyMember;
import org.apache.ibatis.annotations.Param;

/**
 * 老人家属Mapper接口
 * 
 * @author laoYe
 * @date 2025-05-29
 */
@Mapper
public interface FamilyMemberMapper extends BaseMapper<FamilyMember>
{
    /**
     * 查询老人家属
     * 
     * @param id 老人家属主键
     * @return 老人家属
     */
    public FamilyMember selectFamilyMemberById(Long id);

    /**
     * 查询老人家属列表
     * 
     * @param familyMember 老人家属
     * @return 老人家属集合
     */
    public List<FamilyMember> selectFamilyMemberList(FamilyMember familyMember);

    /**
     * 新增老人家属
     * 
     * @param familyMember 老人家属
     * @return 结果
     */
    public int insertFamilyMember(FamilyMember familyMember);

    /**
     * 修改老人家属
     * 
     * @param familyMember 老人家属
     * @return 结果
     */
    public int updateFamilyMember(FamilyMember familyMember);

    /**
     * 删除老人家属
     * 
     * @param id 老人家属主键
     * @return 结果
     */
    public int deleteFamilyMemberById(Long id);

    /**
     * 批量删除老人家属
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFamilyMemberByIds(Long[] ids);

    /**
     * 根据条件查询老人id
     * @param family
     * @return
     */
    Long selectElderId(FamilyDto family);

    /**
     * 查询家人列表
     */
    public List<FamilyMemberElderMy> selectFamilyMemberElderMy(Long userId);

    List<FamilyElderData> selectFamilyElderData(Long userId);

    List<DevicePropertyData> getDeviceData(String deviceId);

    List<DeviceDataByDay> queryDeviceDataListByDay(@Param("iotId") String iotId, @Param("functionId")String functionId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<DeviceDataByDay> queryDeviceDataListByWeek(@Param("iotId") String iotId, @Param("functionId")String functionId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTimee);
}
